import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:
 * Date: 2025-08-31
 * Time: 14:17
 */
public class demo1 {
    public static void main1(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("输入数字n");
        int n = sc.nextInt();
        System.out.println("输入位数m");
        int m = sc.nextInt();

        System.out.println((n >> m) & 1);
    }

    public static void main2(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("输入数字n");
        int n = sc.nextInt();
        System.out.println("输入位数m");
        int m = sc.nextInt();

        System.out.println((n | (1 << m)));
    }

    public static void main3(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("输入数字n");
        int n = sc.nextInt();
        System.out.println("输入位数m");
        int m = sc.nextInt();

        System.out.println(n & (~(1 << m)));
    }

    public static void main4(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("输入数字n");
        int n = sc.nextInt();

        System.out.println(n & (-n));

    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("输入数字n");
        int n = sc.nextInt();

        //System.out.println(n & (~(-n)));
        System.out.println(n & (n-1));

    }
}
